function v = relax(v,f,nu);
%
% 1D weighted Jacobi, w=2/3
%
w = 2/3;
n = length(v)-1;
h = 1/n; hsq=h*h;
%y = v;

for k=1:nu
    v(2:n) = (1-w)*v(2:n) + (w/2)*(v(1:n-1)+v(3:n+1)+hsq*f(2:n));
    v(1) = 0;  v(n+1) = 0;
end
